USE [SI2Final]

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF OBJECT_ID(N'[dbo].[spDesmarcarConsultaEmEspera]', N'P') IS NOT NULL
    DROP procedure [dbo].spDesmarcarConsultaEmEspera;
GO
CREATE PROCEDURE spDesmarcarConsultaEmEspera
	@paciente int,
	@especialidade int,
	@data date
AS
BEGIN
	SET NOCOUNT ON;
	set xact_abort on;
	
BEGIN TRAN	

	delete from ConsultaEmEspera where
		IdPaciente = @paciente and
		IdEspecialidade = @especialidade and
		Data = @data
		
COMMIT TRANSACTION

END
GO
